package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.WxText;
import com.ruoyi.system.api.factory.RemoteMasterFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = ServiceNameConstants.MASTER_SERVICE, contextId = "remoteMasterService",
        value = ServiceNameConstants.MASTER_SERVICE, fallbackFactory = RemoteMasterFallbackFactory.class)
public interface RemoteMasterService {
    /**
     * 处理来自微信公众号的任务
     *
     * @param wxText 微信正文
     * @param source 请求来源
     * @return 结果
     */
    // SecurityConstants.INNER  我使用了内部调用接口 所以不需要网关路由那一段url
    @PostMapping("/task/wxtask")
    public AjaxResult weixinTask(@RequestBody WxText wxText, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
